<?php
/** 
 * $Source: /cvsroot/pn-commerce/pn-commerce/pntemplates/plugins/function.pncGetCountableArray.php,v $
 * $Author: pcornelissen $
 * $Revision: 1.2 $
 * $Date: 2003/12/08 12:09:47 $
 *
 * Type: Function
 *
 * returns an array with params[count] lines to simulate "for loops"
 * @param  count : amount of elements
 * @param  start : (optional) default = 0 result range from start to start+count
 * @param assign - (optional) the variable name for the result, default= count
 */
function smarty_function_pncGetCountableArray($params, &$smarty)
{
    $result=array();
    if(!$params['start'])$params['start']=0;
    if(!$params['assign'])$params['assign']='count';
    for($i=$params['start'];$i<$params['count'];$i++)$result[$i]=$i;
    $smarty->assign( $params['assign'], $result );
}
?>
